package com.timguan.render.api.api.http;

import com.timguan.render.api.api.B2CMallServiceReturnCode;
import com.timguan.render.api.entity.cms.PData;
import com.timguan.render.api.entity.cms.SubMData;
import net.pocrd.annotation.*;
import net.pocrd.define.CommonParameter;
import net.pocrd.define.SecurityType;
import net.pocrd.entity.ServiceException;

/**
 * Created by gkq on 15/11/6.
 */
@ApiGroup(name = "b2cmall", minCode = 9000000, maxCode = 10000000, codeDefine = B2CMallServiceReturnCode.class, owner = "guankaiqiang")
public interface CMSNativeDataService {
    @HttpApi(name = "b2cmall.getSubMData", desc = "根据当前页码查询模块的分页数据", security = SecurityType.None, owner = "guankaiqiang")
    public SubMData getSubMData(
            @ApiAutowired(CommonParameter.applicationId)
            int appId,
            @ApiParameter(required = true, name = "pageId", desc = "页面id")
            int pageId,
            @ApiParameter(required = true, name = "listId", desc = "模块对应的数据")
            int listId,
            @ApiParameter(required = true, name = "pageNumber", desc = "当前的页码")
            int pageNumber) throws ServiceException;

    @DesignedErrorCode({B2CMallServiceReturnCode._C_TOPIC_TYPE_NOT_MATCH})
    @HttpApi(name = "b2cmall.getNativeData", desc = "获取native cms页面数据", security = SecurityType.RegisteredDevice, owner = "guankaiqiang")
    public PData getNativeData(@ApiAutowired(CommonParameter.applicationId) int appId,
                               @ApiAutowired(CommonParameter.versionName) String versionName,
                               @ApiParameter(required = true, desc = "页面标识", name = "identify") String identify,
                               @ApiAutowired(CommonParameter.deviceId) String deviceId) throws ServiceException;
}
